using UnityEngine;
using System.Collections.Generic;

public class CloudManager : MonoBehaviour {

	public GameObject CloudPrefab;
	private GameObject _clouds;

	// Use this for initialization
	void Start ()
	{
		_clouds = new GameObject("tmp.CloudRoot");
		Random.seed = 512;
		for (int i = 0; i < 10; i++)
		{
			float angle;
			Vector3 axis;
			Random.rotation.ToAngleAxis(out angle, out axis);
			var cloud = (GameObject)Instantiate(CloudPrefab);
			cloud.transform.position = new Vector3(0, Balance.SPHERE_RADIUS * (3 + Random.value), 0);
			cloud.transform.RotateAround(Vector3.zero, axis, angle);
			cloud.transform.localScale = new Vector3(2, 2, 2);
			cloud.transform.parent = _clouds.transform;
		}
	}

	// Update is called once per frame
	void Update()
	{
		_clouds.transform.RotateAround(Vector3.zero, Vector3.right, Time.deltaTime * 3);
	}
}
